home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 April / ME_2011_04.iso / [Video-Tutorial] / 9430830 / bookmarks.swf / scripts / frame_1 / DoAction_2.as next >
Encoding:
Text File  |  2009-11-16  |  1.9 KB  |  70 lines

  1. function loadPdBookmarks()
  2. {
  3.    if(_root.pd_bm_object == undefined)
  4.    {
  5.       var _loc2_ = _root.fsp_path + _root.folder + "config/bookmarks.xml";
  6.       _root.pd_bm_xml = new XML();
  7.       _root.pd_bm_xml.ignoreWhite = true;
  8.       _root.pd_bm_xml.onLoad = function(success)
  9.       {
  10.          clearInterval(check_interval);
  11.          enableControler_BmFunctions(true);
  12.          if(success)
  13.          {
  14.             parsePdBmXML();
  15.          }
  16.          else
  17.          {
  18.             _root.pd_bm_object = new Object();
  19.             loadBookmarks();
  20.          }
  21.       };
  22.       if(_root.client_os != "Windows" && _root.useFSP_path == "true")
  23.       {
  24.          check_interval = setInterval(abortLoad,4000);
  25.       }
  26.       _root.pd_bm_xml.load(_loc2_);
  27.    }
  28.    else
  29.    {
  30.       renderBookmarks();
  31.    }
  32. }
  33. function abortLoad()
  34. {
  35.    clearInterval(check_interval);
  36.    _root.pd_bm_object = new Object();
  37.    renderBookmarks();
  38. }
  39. function parsePdBmXML()
  40. {
  41.    _root.pd_bm_object = new Object();
  42.    var _loc6_ = _root.pd_bm_xml.firstChild.firstChild;
  43.    while(_loc6_ != null)
  44.    {
  45.       var _loc8_ = String(_loc6_.attributes.name).split(".")[0];
  46.       var _loc7_ = new Array();
  47.       var _loc3_ = _loc6_.firstChild;
  48.       while(_loc3_ != null)
  49.       {
  50.          var _loc2_ = new Object();
  51.          var _loc4_ = _loc3_.attributes.timecode.split(":");
  52.          var _loc5_ = Number(_loc4_[0]) * 60 + Number(_loc4_[1]);
  53.          _loc2_.sec = _loc5_;
  54.          _loc2_.description = _loc3_.attributes.headline;
  55.          _loc2_.memo = _loc3_.firstChild.nodeValue;
  56.          _loc2_.memo = _loc2_.memo.split(String.fromCharCode(13)).join("");
  57.          if(_loc2_.memo == undefined)
  58.          {
  59.             _loc2_.memo = "";
  60.          }
  61.          _loc2_.pd = true;
  62.          _loc7_.push(_loc2_);
  63.          _loc3_ = _loc3_.nextSibling;
  64.       }
  65.       _root.pd_bm_object[_loc8_] = _loc7_;
  66.       _loc6_ = _loc6_.nextSibling;
  67.    }
  68.    renderBookmarks();
  69. }
  70.